const init = {
    count: 0
}
export default function countReducer(prevState = init, action) {

    const {type, data}= action
    switch (type) {
        case 'inCreatmentCount':
            return {
                ...prevState, count: prevState.count + data
            };
        case 'deCreatmentCount':
            return {
                ...prevState, count: prevState.count - data
            };
            case 'inTimeoutCount':
                return {
                    ...prevState,count:prevState.count + data
                }
    }

    return prevState
}